package com.ll.beautymall.ui.home.categorydetail.presenter;

import com.ll.beautymall.bean.BrandData;
import com.ll.beautymall.ui.home.categorydetail.model.CategoryDetailBiz;
import com.ll.beautymall.ui.home.categorydetail.model.OnGetBrandListLisenter;
import com.ll.beautymall.ui.home.categorydetail.view.ICategoryDetailView;

import java.util.HashMap;

/**
 * Created by Administrator on 2016/10/24.
 */
public class CategoryDetailPresenter {
    private CategoryDetailBiz categoryDetailBiz;
    private ICategoryDetailView categoryDetailView;

    public CategoryDetailPresenter(ICategoryDetailView view) {
        categoryDetailView = view;
        categoryDetailBiz = new CategoryDetailBiz();
    }

    public void setBrandData(HashMap<String, String> parameters) {
        categoryDetailBiz.getBrandData(parameters, new OnGetBrandListLisenter() {
            @Override
            public void onSucced(BrandData brandData) {
                categoryDetailView.setBrandData(brandData);
            }

            @Override
            public void onFailed(String errorMsg) {
                categoryDetailView.showErrorMsg(errorMsg);
            }
        });
    }

}
